\usepackage{enumitem}

\usepackage{tikz}
% \usetikzlibrary{arrows,positioning,calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins, breakable, theorems}

\definecolor{structurecolor}{RGB}{60,113,183}
\definecolor{main}{RGB}{0,166,82}
\definecolor{second}{RGB}{255,134,24}
\definecolor{third}{RGB}{0,174,247}

\definecolor{winered}{rgb}{0.5,0,0}
\definecolor{mybule}{RGB}{18,29,57}
\colorlet{coverlinecolor}{second}
\colorlet{headcolor}{Black}

% \newfontfamily\urlfont{PT Sans Narrow}

\makeatletter
\newcommand{\eqbox}[1]{\textcolor{black}{%
\tikz[baseline={([yshift=-.72ex] current bounding box.center)}] \node [thick, rectangle, minimum width=1ex,rounded corners,fill=yellow!10, draw=orange] {\normalcolor\m@th$\displaystyle#1$};}}
\makeatother

\newcommand{\fn}[1]{\texttt{#1}}
\newcommand{\sfn}[1]{\texttt{\small #1}}
\newcommand{\kw}[1]{\textsf{#1}}
\newcommand{\myurl}[1]{{\urlfont #1}}
\newcommand{\mpar}[1]{\marginpar[\hfill\kaishu #1]{\kaishu #1}}
\newcommand{\mn}[1]{\texttt{\bs #1}}
\renewcommand{\today}{\the\year-\the\month-\the\day}
\newcommand\bs{\textbackslash}

\newtcbox{\mybox}[1][main]
  {on line, arc = 0pt, outer arc = 0pt,
    colback = #1!10!white, colframe = #1!50!black,
    boxsep = 0pt, left = 1pt, right = 1pt, top = 2pt, bottom = 2pt,
    boxrule = 0pt, bottomrule = 1pt, toprule = 1pt}


\newcommand\begindot{\begin{itemize}
[itemsep=2pt plus 2pt minus 2pt,%
topsep=3pt plus 2pt minus 2pt,%
parsep=0pt plus 2pt minus 2pt]}
\newcommand\myenddot{\end{itemize}}

\newcommand\beginnum{\begin{enumerate}
[itemsep=2pt plus 2pt minus 2pt,%
topsep=3pt plus 2pt minus 2pt,%
parsep=0pt plus 2pt minus 2pt]}
\newcommand\myendnum{\end{enumerate}}

\newcommand{\youyuan}{}

\newcounter{wke}[section]
\renewcommand{\thewke}{\arabic{section}.\arabic{wke}}
\newenvironment{wke}
  {\refstepcounter{wke}
   \par\noindent {\textcolor{cyan}{\textsf{\textbf{Example \thewke }}} \hspace*{1pt}}
  }
  {\par\ignorespacesafterend}

\newcommand{\keypoint}[1]{\textbf{\textcolor{red}{#1}}}

\newcommand{\cmt}{\noindent\hspace{-0.25em}\textcolor{Green}{\ding{226}} \hspace{0.2em}}
\newcommand{\sol}{\noindent\hspace{-0.12em}\textcolor{Red}{\ding{45}} \hspace{0.2em}}
\newcommand{\solc}{\noindent\hspace{-0.12em}\textcolor{cyan}{\ding{45}} \hspace{0.2em} \vspace*{-\baselineskip}} 

\newenvironment{hlblk}
  {\centering
   \vspace*{-5pt}
   \begin{tcolorbox}[colframe=Gray,colback=LightGrey!15]
   \setlength{\baselineskip}{\baselineskip}%
  }
  {\end{tcolorbox}}
  % {\end{tcolorbox}\vspace*{-8pt}}

\newenvironment{solution}
  {\par\sol}
  {\par}

\newcommand{\notename}{Note}
\newcommand{\proofname}{Proof}
\newcommand{\problemname}{Problem}
\newcommand{\definitionname}{Definition}
\newcommand{\theoremname}{Theorem}
\newcommand{\axiomname}{Axiom}
\newcommand{\postulatename}{Postulate}
\newcommand{\lemmaname}{Lemma}
\newcommand{\propositionname}{Proposition}
\newcommand{\corollaryname}{Corollary}
\newcommand{\examplename}{Example}
\newcommand{\exercisename}{Exercise}
\newcommand{\remarkname}{Remark}
\newcommand{\assumptionname}{Assumption}
\newcommand{\conclusionname}{Conclusion}
\newcommand{\solutionname}{Solution}
\newcommand{\propertyname}{Property}

\newtcbtheorem{definition}{\definitionname}%
  {enhanced, breakable,
    colback = main!5, colframe = main, colbacktitle = main,
    attach boxed title to top left = {yshift = -2mm, xshift = 5mm},
    boxed title style = {sharp corners},
    fonttitle = \sffamily\bfseries}{def}
\newtcbtheorem{theorem}{\theoremname}%
  {enhanced, breakable,
    colback = second!5, colframe = second, colbacktitle = second,
    attach boxed title to top left = {yshift = -2mm, xshift = 5mm},
    boxed title style = {sharp corners},
    fonttitle = \sffamily\bfseries}{thm}
\newtcbtheorem{proposition}{\propositionname}%
  {enhanced, breakable,
    colback = third!5, colframe = third, colbacktitle = third,
    attach boxed title to top left = {yshift = -2mm, xshift = 5mm},
    boxed title style = {sharp corners},
    fonttitle = \sffamily\bfseries}{pro}

\newenvironment{note}{
  \par\noindent\makebox[-3pt][r]{
    \scriptsize\color{red!90}\textdbend\quad}
    \textbf{\color{second}\notename} \citshape}{\par}

\newenvironment{proof}{
  \par\noindent\textbf{\color{second}\proofname\;}
  \color{black!90}\normalfont}{
  \hfill$\Box$\quad
  \par}

\newenvironment{mysolution}{\par\noindent\textbf{\color{main}\solutionname} \citshape}{\par}
\newenvironment{remark}{\noindent\textbf{\color{second}\remarkname}}{\par}
\newenvironment{assumption}{\par\noindent\textbf{\color{third}\assumptionname} \citshape}{\par}
\newenvironment{conclusion}{\par\noindent\textbf{\color{third}\conclusionname} \citshape}{\par}
\newenvironment{property}{\par\noindent\textbf{\color{third}\propertyname} \citshape}{\par}
\newenvironment{custom}[1]{\par\noindent\textbf{\color{third} #1} \citshape}{\par}
